package com.zhang.pojo;

import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.ToString;

import java.time.LocalDate;

/**
 * 班级实体类
 */
@Data
@ToString
@NoArgsConstructor
public class Classes {
    /**
     * 班级编号
     */
    private int id;
    /**
     * 班级名称
     */
    private String name;
    /**
     * 班级开始时间
     */
    private LocalDate startTime = LocalDate.now();
    /**
     * 班级老师
     */
    private String teacher;
    /**
     * 学生的人数
     */
    private int count;
    /**
     * 班级所属学校
     */
    private School school;

    public Classes(String name, String teacher, int schoolId) {
        this.name = name;
        this.teacher = teacher;
        this.school = new School();
        this.school.setId(schoolId);
    }

    @Override
    public String toString() {
        return "Classes{" +
                "id=" + id +
                ", name='" + name + '\'' +
                ", startTime=" + startTime +
                ", teacher='" + teacher + '\'' +
                ", count=" + count +
                ", school=" + school +
                '}'+"\n";
    }
}
